
export default {
  data() {
    return {
      dataList: [],
      // dataList: [
      //   {
      //     avatar: "https://ide.code.fun/api/image?token=6645cfdaa2432f00114f1e7c&name=a478368f1065e346419e90011c215dad.png",
      //     name: "张雨涵",
      //     time: "2023.02.27 11:11",
      //     money: 100
      //   },
      //   {
      //     avatar: "https://ide.code.fun/api/image?token=6645cfdaa2432f00114f1e7c&name=a478368f1065e346419e90011c215dad.png",
      //     name: "张雨涵",
      //     time: "2023.02.27 11:11",
      //     money: 100
      //   },
      //   {
      //     avatar: "https://ide.code.fun/api/image?token=6645cfdaa2432f00114f1e7c&name=a478368f1065e346419e90011c215dad.png",
      //     name: "张雨涵",
      //     time: "2023.02.27 11:11",
      //     money: 100
      //   },
      //   {
      //     avatar: "https://ide.code.fun/api/image?token=6645cfdaa2432f00114f1e7c&name=a478368f1065e346419e90011c215dad.png",
      //     name: "张雨涵",
      //     time: "2023.02.27 11:11",
      //     money: 100
      //   },
      //   {
      //     avatar: "https://ide.code.fun/api/image?token=6645cfdaa2432f00114f1e7c&name=a478368f1065e346419e90011c215dad.png",
      //     name: "张雨涵",
      //     time: "2023.02.27 11:11",
      //     money: 100
      //   }
      // ],
      height: 0,
      tabsList: ["亲密好友", "普通好友"],
      currentTabs: 0,//当前账户
      currentData: "0.00",
      type: 1,//1亲密好友 2普通好友
      totalYj: 0,//总业绩
      totalNum: 0,//总人数
      userList: [],
      // userList: [
      //   {
      //     avatar: '',
      //     nickname: '张雨涵',
      //     createtime: '2024.05.23 11:23:05',
      //     yeji: '100.00'
      //   },
      //   {
      //     avatar: '',
      //     nickname: '张雨涵',
      //     createtime: '2024.05.23 11:23:05',
      //     yeji: '256254525.00'
      //   }
      // ],//测试数据
    };
  },
  methods: {
    // // 滚动到底部
    // scrollToBottom() {
    //   this.$refs.scroll.scrollToBottom();
    // },
    // // 滚动到顶部
    // scrollToTop() {
    //   this.$refs.scroll.scrollToTop();
    // }
    changeTabs(index) {
      this.currentTabs = index;
      this.type = index + 1;
      this.getData();
    },
    getData() {
      var that = this;
      $http.post("TuWenhua.order_price", {
        uid: localStorage.getItem("uid")? localStorage.getItem("uid") : localStorage.getItem("mid"),
        type: this.type
      }).then(res => {
        if (res.result == 1) {
          console.log(res,'ressssss');
          // that.currentData = res.data;
          that.currentData = res.data.money;//当前账户 钱
          that.totalYj = res.data.all_yeji;//总业绩
          that.totalNum = res.data.num;//总人数
          that.userList = res.data.user;
          // return this.$toast(res.msg)
        }
      });
    }
  },
  watch: {
    height(newVal) {
      this.$nextTick(() => {
        this.height = this.$refs.myDiv.offsetHeight;
        console.log("Div的新高度是:", this.height);
      });
    }
  },
  activated(){
    this.getData();
  },
  mounted() {
    
    // this.scrollToBottom();
    this.$nextTick(() => {
      // 获取元素的高度
      this.height = this.$refs.myDiv.offsetHeight;
      // 或者
      // let height = this.$refs.myDiv.clientHeight;
      // 或者使用getBoundingClientRect()获取更详细的信息
      // let rect = this.$refs.myDiv.getBoundingClientRect();
      // let height = rect.height;

      console.log("Div的高度是:", this.height);
    });
  },
  components: {
    U_foot: () => import("../../../components/new_diy/foot.vue")
  }
};